import request from '@/utils/request'

// 本年总量
export function getProducesCoreQuantity(date) {
  return request(
    {
      url: '/app/v1/produces/core/completed-quantity',
      method: 'get',
      params: { date }
    }
  )
}
// 本年总量
export function getProducesYearQuantity(factoryType) {
  return request(
    {
      url: '/app/v1/produces/year/completed-quantity',
      method: 'get',
      params: { factoryType }
    }
  )
}
// 生产近6月趋势
export function getSixMonthProduces(factoryType) {
  return request(
    {
      url: '/app/v1/produces/trend/6month',
      method: 'get',
      params: { factoryType }
    }
  )
}

// 生产报工-近30天工厂类型趋势图
export function getFactoryTypeTrend30Day(factoryType) {
  return request(
    {
      url: '/app/v1/produces/trend/30days',
      method: 'get',
      params: { factoryType }
    }
  )
}

// 工厂产能
export function getProducesFactoryQuantity({ factoryType, date }) {
  return request(
    {
      url: '/app/v1/produces/factory-complete-quantity',
      method: 'get',
      params: { factoryType, date }
    }
  )
}

// 生产报工-各工厂类型报工数(日/月)
export function getFactoryTypeDayMonth(date) {
  return request(
    {
      url: '/app/v1/produces/factoryType/dayMonth',
      method: 'get',
      params: { date }
    }
  )
}

// 定制分厂产量
export function getCustomizedCompleteQuantity({ date }) {
  return request(
    {
      url: '/app/v1/produces/second-customized-complete-quantity',
      method: 'get',
      params: { date }
    }
  )
}

// 定制分厂指定类型-近30天产量趋势图
export function getCustomizedComplete30Day({ date, factoryName }) {
  return request(
    {
      url: '/app/v1/produces/second-customized-30days-complete-quantity',
      method: 'get',
      params: { date, factoryName }
    }
  )
}

// 定制分厂指定类型-产线查产量占比
export function getCustomizedProductLineRateQuantity({ date, factoryName }) {
  return request(
    {
      url: '/app/v1/produces/second-customized-product-line-rate-quantity',
      method: 'get',
      params: { date, factoryName }
    }
  )
}
